<?php #//AJAX PHP PENNY AUCTION v.1.1

#///////////////////////////////////////////////////////////
#//  COPYRIGHT 2009 Aaron Helmlinger ALL RIGHTS RESERVED  //
#///////////////////////////////////////////////////////////

require('./includes/config.inc.php');

/* get active bids for this user */

  
// GET BID HISTORY

$query = "select * from PHPAUCTIONXL_bids2 where bidder='$_SESSION[PHPAUCTION_LOGGED_IN]' ORDER BY bidwhen DESC LIMIT 0,25";
$result_numbids = mysql_query ($query);
$num_auction2 = mysql_num_rows($result_numbids);

 $ii = 0;
             $tplv = "";

while($ii < $num_auction2) {

       $ends_h = "";

      if($rowclass == 0)
 
 { 
 $rowbackground = "row0";

 }
              
      if($rowclass == 1)
  { 
 $rowbackground = "row1";

$rowclass = -1;
 }        


$rowclass++;



      

  $high_bidder 	= mysql_result($result_numbids,$ii,"current_high_bidder");
$high_bid 	= mysql_result($result_numbids,$ii,"bid");
$ends_date = mysql_result($result_numbids,$ii,"bidwhen");
$auction_id = mysql_result($result_numbids,$ii,"auction");
     

                       $ends_y =       substr ($ends_date, 0, 4);
                       $ends_m =       substr ($ends_date, 4, 2);
                       $ends_d =       substr ($ends_date, 6, 2);
            
            
            if (substr ($ends_date, 8, 2)>12) {
  $ends_h .= "0";
$ends_h .= substr ($ends_date, 8, 2)-12;
$jsampm = "PM";
}
if (substr ($ends_date, 8, 2) < 12) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "AM";
}
     if (substr ($ends_date, 8, 2) == 12) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "PM";
}
if (substr ($ends_date, 8, 2) == 0) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "AM";
}
            
            
                       $ends_min =     substr ($ends_date, 10, 2);
                       $ends_sec =     substr ($ends_date, 12, 2); 
     
     
     
     
            
                          $query_title1 = "select title from PHPAUCTIONXL_auctions2 where id=$auction_id";
                             $query_title2 =  mysql_query ($query_title1);
                                $title = mysql_result($query_title2,0,"title");
             
                 $tplv .= "<tr VALIGN=MIDDLE BGCOLOR=\"\" id=$rowbackground>";

$tplv .= "<td ALIGN=LEFT><a href=\"item.php?id=".$auction_id."\">$title</a></td>";
       
                    $bid = $currency_symbol.print_money_nosymbol($high_bid);

                       $tplv .=
                       "<td align=center>".
                     
                       $bid.
                        "</td>";

         $tplv .= "<td align=center>$ends_m/$ends_d/$ends_y $ends_h:$ends_min:$ends_sec $jsampm</td>";

                       $tplv .= "</tr>\r";    
             
             
$ii++;

}
                      //$tplv .= "</TABLE>";  
              $TPL_auctions_list_value = $tplv;



include "header.php";
include phpa_include("template_yourbids_php.html");
include "footer.php";

?>